package com.gpnu.crm.util;

import com.gpnu.crm.domain.Employee;
import com.gpnu.crm.service.IEmployeeService;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;

//用户上下文工具类类
public abstract class UserContext {
    public static Employee getCurrentUser() {
        return (Employee) SecurityUtils.getSubject().getPrincipal();
    }

    //判断当前用户是否管理员或者经理
   /* public static boolean isAdminOrMgr() {
        Subject subject = SecurityUtils.getSubject();
        if (getCurrentUser().isAdmin() || subject.hasRole("客户经理")) {
            return true;
        }
        return false;
    }*/
}
